package io;

import java.io.BufferedWriter;
import java.nio.charset.Charset;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.SortedMap;
import java.util.concurrent.locks.ReentrantLock;

public class AvailableCharSets {
	public static void main(String[] args) {
		SortedMap<String, Charset>charsets=Charset.availableCharsets();
		Iterator<String>iterator=charsets.keySet().iterator();
		while(iterator.hasNext()){
			String csName=iterator.next();
			System.out.println(csName);
			Iterator aliases=charsets.get(csName).aliases().iterator();
			if(aliases.hasNext()){
				System.out.println(": ");
			}
			while(aliases.hasNext()){
				System.out.println(aliases.next());
				if(aliases.hasNext()){
					System.out.println(": ");
				}
			}
		}
		Set<String>set=new HashSet<>();
		//set.re
	}
}
